


local role_mode = fk.CreateGameMode{
  name = "wuming_mode", -- just to let it at the top of list
  minPlayer = 2,
  maxPlayer = 8,
  main_mode = "role_mode",
  logic = function()
    local l = GameLogic:subclass("wuming_mode_logic")
    function l:run()
      self.room.settings.enableDeputy = false
      GameLogic.run(self)
    end

    function l:chooseGenerals()
      local room = self.room---@type Room
      local players = room.players
      local generalNum = room.settings.generalNum
      local lord = room:getLord()
      if not lord then
        local temp = room.players[1]
        temp.role = "lord"
        lord =  temp
      end
      room:setCurrent(lord)


      local general = "wuming"
      for _, p in ipairs(players) do
        room:findGeneral(general)
        room:prepareGeneral(p, general, "")
      end
      room:askToChooseKingdom(players)
      room:broadcastProperty(lord, "kingdom")

      local lord_skills = Fk.generals[lord.general]:getSkillNameList(true)
      for _, sname in ipairs(lord_skills) do
        local skill = Fk.skills[sname]
        if not skill:hasTag(Skill.AttachedKingdom) or table.contains(skill:getSkeleton().attached_kingdom, lord.kingdom) then
          room:doBroadcastNotify("AddSkill",{ lord.id, sname })
        end
      end

    end

    return l
  end,
  surrender_func = Fk.game_modes["aaa_role_mode"].surrenderFunc
}

Fk:loadTranslationTable{
  ["wuming_mode"] = "单将无名",
  [":wuming_mode"] = "就是禁用了副将且所有人选择无名的身份模式。",
  ["#wuming_mode"] = "单将无名规则",
}

return role_mode
